package com.mycompany.project.client;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class TestLogger implements EntryPoint {
	
	private final Log log = LogFactory.getLog(TestLogger.class);
	
	private Button clickMeButton;
	public void onModuleLoad() {
		RootPanel rootPanel = RootPanel.get();

		final HorizontalPanel horizontalPanel = new HorizontalPanel();
		rootPanel.add(horizontalPanel, 0, 0);

		final TextBox loggerTextTextBox = new TextBox();
		horizontalPanel.add(loggerTextTextBox);
		loggerTextTextBox.setText("Logger Text");

		clickMeButton = new Button();
		horizontalPanel.add(clickMeButton);
		clickMeButton.setText("Click me to test Logger");
		clickMeButton.addClickListener(new ClickListener() {
			public void onClick(Widget sender) {
				log.info(loggerTextTextBox.getText());
			}
		});
	}
}
